﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<MedicinaMuncii.Entities.Employee>>"
    Theme="Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    <%: Resources.Global.EmployeeIndexPageTitle %>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        <%: Resources.Global.EmployeeIndexPageTitle %>
    </h2>
    <% Html.Telerik().Grid(Model).Name("Employees")
    .Columns(columns =>
    {
        columns.Bound(o => o.ID).Hidden();
        columns.Bound(o => o.person.FullName).Title(Resources.Global.NameLabel);
        columns.Bound(o => o.company.Name).Title(Resources.Global.CompanyLabel);
        columns.Bound(o => o.Number).Title(Resources.Global.NumberLabel);
        columns.Bound(o => o.Occupation).Title(Resources.Global.OccupationLabel);
        columns.Bound(o => o.Position).Title(Resources.Global.PositionLabel);
        columns.Bound(o => o.WorkPlace).Title(Resources.Global.WorkPlaceLabel);
        columns.Template(o =>
        { %>
    <a class="t-grid-action t-button t-state-default t-grid-edit" href="<%= Url.Action("Edit", "Employee", new { id = o.ID}) %>">
        <span class="t-icon t-edit"></span>
        <%: Resources.Global.EditButton%>
    </a>
    <a class="t-grid-action t-button t-state-default t-grid-delete" href="<%= Url.Action("Delete", "Employee", new { id = o.ID}) %>">
        <span class="t-icon t-edit"></span>
        <%: Resources.Global.DeleteButton%>
    </a>
    <% });
    })
    .Pageable()
    .Sortable(sorting => sorting.OrderBy(sortOrder => sortOrder.Add(o => o.person.FullName)))
    .Render(); %>
    <div class="addnew-button-bar">
        <a class="t-grid-action t-button t-state-default t-grid-add" href="<%=Url.Action("Create", "Employee")%>">
            <span class="t-icon t-add"></span>
            <%: Resources.Global.AddNewLabel %>
        </a>
    </div>
</asp:Content>
